//package com.rayo.accesscontrollercopy.model.db.bean;
//
//import com.rayo.wallreader.data.CardBasicInfo;
//import com.rayo.wallreader.data.CardTypeEnum;
//import com.rayo.wallreader.data.KeyBasicInfo;
//import com.rayo.wallreader.data.KeyEventInfo;
//import com.rayo.wallreader.data.KeyType;
//import com.rayo.wallreader.data.ProCardInfo;
//import com.rayo.wallreader.data.ProKeyInfo;
//import com.rayo.wallreader.data.UserCardInfo;
//import com.rayo.wallreader.data.UserKeyInfo;
//import com.rayo.wallreader.utils.TimeUtils;
//
//import java.util.ArrayList;
//import java.util.Calendar;
//import java.util.Date;
//import java.util.List;
//
///**
// * Created by yanghaojie on 16/7/12.
// */
//public class KeyDefineData {
//    private KeyBasicInfo mKeyBasicInfo;
//
////    private ProKeyInfo mProKeyInfo;
//
//    private UserKeyInfo mUserKeyInfo;
//
//    private KeyEventInfo mKeyEventInfo;
//
////    private CardBasicInfo mCardBasicInfo;
////
////    private UserCardInfo mUserCardInfo;
////
////    private ProCardInfo mProCardInfo;
//
//    public KeyDefineData() {
//        this.newKeyBasicInfo();
//        this.newUserKeyInfo();
//        this.newCardBasicInfo();
//        this.newUserCardInfo();
//    }
//
//    public KeyBasicInfo newKeyBasicInfo() {
//        return mKeyBasicInfo = new KeyBasicInfo();
//    }
//
//    public KeyBasicInfo getmKeyBasicInfo() {
//        return mKeyBasicInfo;
//    }
//
////    public ProKeyInfo newProKey() {
////        mProKeyInfo = new ProKeyInfo();
////        return mProKeyInfo;
////    }
////
////    public ProKeyInfo newSettingKey() {
////        mKeyBasicInfo.setKeyId(1);
////        mKeyBasicInfo.setType(KeyType.SETTING_KEY.toInteger());
////        mKeyBasicInfo.setKeyTime(TimeUtils.calToBytesYMDWHMS(Calendar
////                .getInstance()));
////        mProKeyInfo = new ProKeyInfo();
////        byte[] setting = {0x1, 0x0, 0x2, 0x0};
////        mProKeyInfo.setSettingKey(setting);
////        return mProKeyInfo;
////    }
////
////    public ProKeyInfo newSystemCodeKey() {
////        mKeyBasicInfo.setKeyId(1);
////        mKeyBasicInfo.setType(KeyType.SYSCODE_KEY.toInteger());
////        mKeyBasicInfo.setKeyTime(TimeUtils.calToBytesYMDWHMS(Calendar
////                .getInstance()));
////        mProKeyInfo = new ProKeyInfo();
////        byte[] code = {0x36, 0x36, 0x36, 0x36};
////        mProKeyInfo.setSystemCodeKey(code);
////        return mProKeyInfo;
////    }
////
////    public ProKeyInfo newBlackListKey() {
////        mKeyBasicInfo.setKeyId(1);
////        mKeyBasicInfo.setType(KeyType.LOSS_KEY.toInteger());
////        mKeyBasicInfo.setKeyTime(TimeUtils.calToBytesYMDWHMS(Calendar
////                .getInstance()));
////        mProKeyInfo = new ProKeyInfo();
////        byte[] blacklist = {0x1, 0x0, 0x2, 0x0, 0x3, 0x0, 0x4, 0x0, 0x5, 0x0,
////                0x6, 0x0, 0x7, 0x0, 0x8, 0x0, 0x9, 0x0, 0xa, 0x0};
////        mProKeyInfo.setBlackListKey(blacklist);
////        return mProKeyInfo;
////    }
////
////    public ProKeyInfo newEventKey() {
////        mKeyBasicInfo.setKeyId(1);
////        mKeyBasicInfo.setType(KeyType.EVENT_KEY.toInteger());
////        mKeyBasicInfo.setKeyTime(TimeUtils.calToBytesYMDWHMS(Calendar
////                .getInstance()));
////        mProKeyInfo = new ProKeyInfo();
////        return mProKeyInfo;
////    }
////
////    public ProKeyInfo newEngineeringKey() {
////        mKeyBasicInfo.setKeyId(1);
////        mKeyBasicInfo.setType(KeyType.ENG_KEY.toInteger());
////        mKeyBasicInfo.setKeyTime(TimeUtils.calToBytesYMDWHMS(Calendar
////                .getInstance()));
////        mProKeyInfo = new ProKeyInfo();
////        Calendar nowtime = Calendar.getInstance();
////        mProKeyInfo.setKeyIssueTime(TimeUtils.dateToBytesYMDHM(nowtime
////                .getTime()));
////        mProKeyInfo.setEngineeringKeyStart(TimeUtils.dateToBytesYMDHM(nowtime
////                .getTime()));
////        nowtime.add(Calendar.HOUR_OF_DAY, 2);
////        mProKeyInfo.setEngineeringKeyEnd(TimeUtils.dateToBytesYMDHM(nowtime
////                .getTime()));
////        return mProKeyInfo;
////    }
////
////    public ProKeyInfo newEmergencyKey() {
////        mKeyBasicInfo.setKeyId(1);
////        mKeyBasicInfo.setType(KeyType.EMERGENCY_KEY.toInteger());
////        mKeyBasicInfo.setKeyTime(TimeUtils.calToBytesYMDWHMS(Calendar
////                .getInstance()));
////        mProKeyInfo = new ProKeyInfo();
////        Calendar nowtime = Calendar.getInstance();
////        mProKeyInfo.setKeyIssueTime(TimeUtils.dateToBytesYMDHM(nowtime
////                .getTime()));
////        mProKeyInfo.setEmergencyKeyStart(TimeUtils.dateToBytesYMDHM(nowtime
////                .getTime()));
////        nowtime.add(Calendar.HOUR_OF_DAY, 2);
////        mProKeyInfo.setEmergencyKeyEnd(TimeUtils.dateToBytesYMDHM(nowtime
////                .getTime()));
////        return mProKeyInfo;
////    }
////
////    public ProKeyInfo newReadLockIdKey() {
////        mKeyBasicInfo.setKeyId(1);
////        mKeyBasicInfo.setType(KeyType.READLOCKID_KEY.toInteger());
////        mKeyBasicInfo.setKeyTime(TimeUtils.calToBytesYMDWHMS(Calendar
////                .getInstance()));
////        mProKeyInfo = new ProKeyInfo();
////        return mProKeyInfo;
////    }
////
////    public ProKeyInfo newReadSerialKey() {
////        mKeyBasicInfo.setKeyId(1);
////        mKeyBasicInfo.setType(KeyType.READLOCKNUM_KEY.toInteger());
////        mKeyBasicInfo.setKeyTime(TimeUtils.calToBytesYMDWHMS(Calendar
////                .getInstance()));
////        mProKeyInfo = new ProKeyInfo();
////        return mProKeyInfo;
////    }
////
////    public ProKeyInfo getmProKeyInfo() {
////        return mProKeyInfo;
////    }
//
//    public UserKeyInfo newBlankUserKeyInfo() {
//        return mUserKeyInfo = new UserKeyInfo();
//    }
//
//    public UserKeyInfo newUserKeyInfo() {
//
//        mKeyBasicInfo.setKeyId(1);
//        mKeyBasicInfo.setType(KeyType.USER_KEY.toInteger());
//        mKeyBasicInfo.setKeyTime(TimeUtils.calToBytesYMDWHMS(Calendar
//                .getInstance()));
//        mUserKeyInfo = new UserKeyInfo();
//        Calendar nowtime = Calendar.getInstance();
//        mUserKeyInfo.setKeyIssueTime(TimeUtils.dateToBytesYMDHM(nowtime
//                .getTime()));
//        mUserKeyInfo.setKeyStartTime(TimeUtils.dateToBytesYMDHM(nowtime
//                .getTime()));
//        nowtime.add(Calendar.MONTH, 1);
//        mUserKeyInfo
//                .setKeyEndTime(TimeUtils.dateToBytesYMDHM(nowtime.getTime()));
//        mUserKeyInfo.setValidDayCount(0);
//
//
//
//
//
//
////        // Calendar
//        List<UserKeyInfo.CalendarInfo> CalList = new ArrayList<>();
//        for (int cal = 0; cal < 30; cal++) {
//            UserKeyInfo.CalendarInfo calday = new UserKeyInfo.CalendarInfo();
//            calday.CalDate = Calendar.getInstance();
//            calday.CalDate.add(Calendar.DATE, cal + 10);
//            calday.Type = cal % 4;
//            CalList.add(calday);
//        }
//        mUserKeyInfo.setCalendarInfo(CalList);
////
//        // DaylightSaving
//        UserKeyInfo.DSTInfo dst = new UserKeyInfo.DSTInfo();
//        dst.BeginDate = Calendar.getInstance();
//        dst.EndDate = Calendar.getInstance();
//        dst.EndDate.add(Calendar.MONTH, 6);
//        mUserKeyInfo.setDST(dst);
//
////         Timezone
////         Timezone MAX：200；Time MAX：12
//        List<UserKeyInfo.TimezoneInfo> timeList = new ArrayList<UserKeyInfo.TimezoneInfo>();
//        List<UserKeyInfo.ZoneInfo> zoneList = new ArrayList<UserKeyInfo.ZoneInfo>();
//        for (int z = 0; z < 10; z++) {
//            for (int t = 0; t < 12; t++) {
//                UserKeyInfo.TimezoneInfo time = new UserKeyInfo.TimezoneInfo();
//                Date date = new Date(13, 5, 00, 00, 00);
//                time.ZoneNo = z + 1;
//                time.TimeNo = t + 1;
//                time.From.setTime(date);
//                date = new Date(18, 8, 19, 23, 59);
//                time.To.setTime(date);
//                time.Su = true;
//                time.Mo = true;
//                time.Tu = true;
//                time.We = true;
//                time.Th = true;
//                time.Fr = true;
//                time.Sa = true;
//                time.Hol = true;
//                time.Sp1 = true;
//                time.Sp2 = true;
//                timeList.add(time);
//            }
//            UserKeyInfo.ZoneInfo zone = new UserKeyInfo.ZoneInfo();
//            zone.ZoneNo = z + 1;
//            zone.TimeCount = 12;
//            zoneList.add(zone);
//        }
//        mUserKeyInfo.setTimezoneInfo(timeList);
//        mUserKeyInfo.setZoneInfo(zoneList);
//        mUserKeyInfo.setTimezoneCount(zoneList.size());
//
//        // Opens MAX：3000
//        List<UserKeyInfo.Open> openList = new ArrayList<UserKeyInfo.Open>();
//        for (int open = 0; open < 200; open++) {
//                                                           //2
//            UserKeyInfo.Open opens = new UserKeyInfo.Open(0, 4, open + 1, 1);
//            if (open < 100) {
//                opens.Flag = 0;
//            } else {
//                opens.Flag = 1;
//            }
//            openList.add(opens);
//        }
//        mUserKeyInfo.setOpens(openList);
//
//        // TempOpens MAX：100
//        List<UserKeyInfo.TempOpen> tempList = new ArrayList<UserKeyInfo.TempOpen>();
//        for (int temp = 0; temp < 10; temp++) {
//            UserKeyInfo.TempOpen topen = new UserKeyInfo.TempOpen();
//            topen.EndDate.add(Calendar.MONTH, 2);
//            topen.FromTime.set(Calendar.HOUR_OF_DAY, 8);
//            topen.FromTime.set(Calendar.MINUTE, 30);
//            topen.ToTime.set(Calendar.HOUR_OF_DAY, 22);
//            topen.ToTime.set(Calendar.MINUTE, 30);
//            topen.LockId = temp + 1;
//            tempList.add(topen);
//        }
//        mUserKeyInfo.setTempOpens(tempList);
//        return mUserKeyInfo;
//    }
//
//    public UserKeyInfo getUserKeyInfo() {
//        return mUserKeyInfo;
//    }
//
//    public KeyEventInfo getmKeyEventInfo() {
//        return mKeyEventInfo;
//    }
//
//    public KeyEventInfo newKeyEventInfo() {
//        mKeyEventInfo = new KeyEventInfo();
//        return mKeyEventInfo;
//    }
//
//    public UserCardInfo getmUserCardInfo() {
//        return mUserCardInfo;
//    }
//
//    public void setmUserCardInfo(UserCardInfo mUserCardInfo) {
//        this.mUserCardInfo = mUserCardInfo;
//    }
//
//    public CardBasicInfo getmCardBasicInfo() {
//        return mCardBasicInfo;
//    }
//
//    public void setmCardBasicInfo(CardBasicInfo mCardBasicInfo) {
//        this.mCardBasicInfo = mCardBasicInfo;
//    }
//
//    public CardBasicInfo newCardBasicInfo() {
//        this.mCardBasicInfo = new CardBasicInfo();
//        this.mCardBasicInfo.setCardId(1);
//        this.mCardBasicInfo.setCardType(CardTypeEnum.USER_CARD.toByte());
//        return mCardBasicInfo;
//    }
//
//    public UserCardInfo newUserCardInfo() {
//        this.mCardBasicInfo.setCardType(CardTypeEnum.USER_CARD.toInteger());
//        this.mUserCardInfo = new UserCardInfo();
//        mUserCardInfo.setCardIssueTime(TimeUtils.dateToBytesYMDHMS(new Date()));
//        int[] lockList = new int[40];
//        for (int i = 0; i < 40; i++) {
//            lockList[i] = i + 1;
//        }
//        mUserCardInfo.setLockList(lockList);
//        mUserCardInfo.setIsBlack(UserCardInfo.NOT_BLACK);
//        for (int j = 0; j < 3; j++) {
//            CardBasicInfo.Timezone timezone = new CardBasicInfo.Timezone(Calendar.getInstance(), Calendar.getInstance(),
//                    Calendar.getInstance(), Calendar.getInstance(), true, true, true, true, true, true, true);
//            mUserCardInfo.getTimeList().add(timezone);
//        }
//        return mUserCardInfo;
//    }
//
//    public ProCardInfo newSettingCard() {
//        this.mCardBasicInfo.setCardType(CardTypeEnum.SETTING_CARD.toInteger());
//        this.mProCardInfo = new ProCardInfo();
//        for (int j = 0; j < 4; j++) {
//            CardBasicInfo.Timezone timezone = new CardBasicInfo.Timezone(Calendar.getInstance(), Calendar.getInstance(),
//                    Calendar.getInstance(), Calendar.getInstance(), true, true, true, true, true, true, true);
//            mProCardInfo.getTimeList().add(timezone);
//        }
//        mProCardInfo.setLockId(1);
//        mProCardInfo.setGroupId(2);
//        mProCardInfo.setOpenMode(3);
//        return mProCardInfo;
//    }
//
//    public ProCardInfo newBlackCard() {
//        this.mCardBasicInfo.setCardType(CardTypeEnum.BLACKLIST_CARD.toInteger());
//        this.mProCardInfo = new ProCardInfo();
//        int[] list = new int[20];
//        for (int i = 0; i < 20; i++) {
//            list[i] = i + 1;
//        }
//        mProCardInfo.setBlackListCard(list);
//        return mProCardInfo;
//    }
//
//    public ProCardInfo getmProCardInfo() {
//        return mProCardInfo;
//    }
//
//    public void setmProCardInfo(ProCardInfo mProCardInfo) {
//        this.mProCardInfo = mProCardInfo;
//    }
//}
